package com.study.springboot.mybatisplugin.dao;

import com.study.springboot.mybatisplugin.Category;
import javafx.scene.control.Pagination;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
public interface CategoryMapper {

//    List<Category> findAllCategory();
//
//    List<Category> findSomeColumn();
//
//    void deleteById(Integer id);
//
//    void updateByPrimarKeySelective(Category student);

     void saveCategory(Category student);
     void updateCategory(Category student);
     Category findById(int id);

//    List<Category> findAllCategoryPage(Pagination page);


    @Select("select * from category ")
    @Results({
            @Result(column="id",property="id"),
            @Result(column="name",property="name"),
            @Result(column="descr",property="descr"),
            @Result(column="createTime",property="create_time"),
            @Result(column="updateTime",property="update_time")
    })
    List<Category> findAllCategory();

//    List<Category> findAllCategory2();
}
